﻿using UnityEngine;
using System.Collections;

public class RespawnOutside : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}


	void OnTriggerExit(Collider other) {
		
		RespawnPlayer player = other.GetComponent< RespawnPlayer > ();
		if (player) 
		{
			player.Respawn();
		}

		SheepPather sheep = other.GetComponent< SheepPather > ();
		if (sheep) 
		{
			Destroy(sheep.gameObject);
		}
	}
}
